package com.jcl.recruit.org.mapper;

import com.jcl.recruit.org.model.Job;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;
import java.util.Map;

/**
 * @author 刘明新
 * @date 2018/8/7 上午9:17
 */
public interface JobMapper {

    @Select({
            "select * from job where status != -1 order by id desc"
    })
    List<Map<String,Object>> selectAllJobs();

    @InsertProvider(type=JobSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(Job record);

    @UpdateProvider(type=JobSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Job record);
}
